<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/head.jsp"%>
<div class="bjui-pageContent">
	<h3>${modifybean.name }.问卷调查分析</h3>
	<input type="hidden" value="${modifybean.id}" name="quesId" />
	<div class="col-1">
		<c:forEach items="${list }" var="item">
			<fieldset>
				<legend style="font-weight: normal;">${item.name }：</legend>
				<c:forEach items="${item.list }" var="itemlist" varStatus="itemliststa">
					<div class="bs-callout bs-callout-warning">
						<h4>${itemliststa.count}.${itemlist.question }</h4>
						<c:if test="${itemlist.typesel=='单选' || itemlist.typesel=='多选' }">
							<div id="containeritemlist${itemlist.id }" style="min-width: 310px; max-width: 800px; height: 400px;"></div>
							<table class="table table-bordered" data-toggle="tablefixed" data-width="400px" data-nowrap="true">
								<thead>
									<tr>
										<th>选项</th>
										<th>占比</th>
									</tr>
								</thead> 
								<tbody>
									<c:forEach items="${itemlist.list}" var="item123">
										<tr data-id="${item.id }">
											<td>${item123.options}</td>
											<td>${item123.percent}%</td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
							<script type="text/javascript">
								$(function() {
									$('#containeritemlist${itemlist.id}').highcharts({
										chart : {
											type : 'bar'
										},
										title : {
											text : '分析'
										},
										xAxis : {
											categories : ${itemlist.anlnames},
											title : {
												text : null
											}
										},
										yAxis : {
											min : 0,
											title : {
												text : '得票数 (次)',
												align : 'high'
											},
											labels : {
												overflow : 'justify'
											}
										},
										tooltip : {
											valueSuffix : ' 次'
										},
										plotOptions : {
											bar : {
												dataLabels : {
													enabled : true
												}
											}
										},
										legend : {
											layout : 'vertical',
											align : 'right',
											verticalAlign : 'top',
											x : -40,
											y : 80,
											floating : true,
											borderWidth : 1,
											backgroundColor : ((Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'),
											shadow : true
										},
										credits : {
											enabled : false
										},
										series : [ {
											name : '结果',
											data : ${itemlist.anlvalues}
										}]
									});
								});
							</script>
						</c:if>
						<c:if test="${itemlist.typesel=='填空'  }">
							<p>
								<c:forEach items="${itemlist.list }" var="ansitem" varStatus="ansitemstats">
									<code>${ansitemstats.count}. ${ansitem.answer}</code>
								</c:forEach>
							</p>
						</c:if>
						<c:if test="${  itemlist.typesel=='文本'}">
							<p>
								<c:forEach items="${itemlist.list }" var="ansitem" varStatus="ansitemstats">
									<code>${ansitemstats.count}. ${ansitem.answer}</code><br/>
								</c:forEach>
							</p>
						</c:if>
					</div>
				</c:forEach>
			</fieldset>
		</c:forEach>
	</div>
</div>
<div class="bjui-pageFooter">
	<ul>
	</ul>
</div>
